# # # # import json
# # # # import os
# # # # import re, ast
# # # #
# # # # import requests
# # # #
# # # # # a = """{'input_case_url': 'https://api.test.douchacha.com/api/tiktok/live/list_hour?sign=df-dcc',
# # # # #      'input_case_type': 'GET',
# # # # #      'input_case_token': 'eyJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjoiUEMiLCJleHAiOjE2Mjk4MDMwMTEsInVzZXJJZCI6MTI4MzQwMTg1NjQwODQ1NzIxNywiY3JlYXRlRGF0ZSI6IjIwMjEtMDgtMjMgMTk6MDM6MzEifQ.BOOPuINOT0U-_rtI9cH3kCOoiKcsXVU33D1qa6JoMhs',
# # # # #      'input_case_data': '{"phone": "18900000134","password": "e252ba01bf6a505c330cbb3eb58645fca69dfe4a"}'}"""
# # # # #
# # # # # aa=re.findall(r"(h.*)",a)[0]
# # # # # print(aa.replace("',",''))
# # # # # print(re.search(r"({.*?})", a))
# # # # ipconfig = os.popen("ipconfig")
# # # #
# # # # ipconfig_list = [i.split("\n") for i in ipconfig]
# # # # if ipconfig_list[8] != ['', '']:
# # # #     ipconfig = ipconfig_list[8]
# # # # else:
# # # #     ipconfig = ipconfig_list[-3]
# # # #
# # # # proxies = {"https": f"{ipconfig[0].split(':')[-1].replace(' ', '')}:8888"}
# # # # print(f"当前电脑IP: {proxies}")
# # # #
# # # #
# # # # def yellowlab(self,url):
# # # #     yellowlaburl = 'https://yellowlab.tools/api/runs'
# # # #     yellow = requests.Session()
# # # #     payload = {
# # # #         "url": url,
# # # #         "waitForResponse": False,
# # # #         "screenshot": True,
# # # #         "device": "desktop"
# # # #     }
# # # #     header = {
# # # #         "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
# # # #         "content-type": "application/json;charset=UTF-8",
# # # #         "sec-fetch-site": "same-origin",
# # # #         "sec-fetch-mode": "cors",
# # # #         "sec-fetch-dest": "empty"}
# # # #     response = yellow.post(yellowlaburl, data=json.dumps(payload), headers=header, proxies=proxies, verify=False)
# # # #     yellowlaburl = 'https://yellowlab.tools/api/runs/%s' % response.json()['runId']
# # # #     header = {
# # # #         "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
# # # #         "sec-fetch-site": "same-origin",
# # # #         "sec-fetch-mode": "cors",
# # # #         "sec-fetch-dest": "empty"
# # # #     }
# # # #     response = yellow.get(url=yellowlaburl, headers=header, proxies=proxies, verify=False)
# # # #     runId = response.json()['runId']
# # # #     return runId
# # # #
# # # #
# # # # print(yellowlab('https://www.baidu.com'))
# # # import os
# # #
# # # url = "https://www.baidu.com/"
# # # token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3ZWJUeXBlIjoiUEMiLCJleHAiOjE2MzA2NTYyMzIsInVzZXJJZCI6IjE0MTczNjMyMjY2ODI4Njc3MTMiLCJ1c2VyIjoie1wiY3JlYXRlQXRcIjpcIjIwMjEtMDctMjBUMTM6NTg6MjFcIixcImVuYWJsZVVzaW5nXCI6XCJVUFwiLFwiaWRcIjpcIjE0MTczNjMyMjY2ODI4Njc3MTNcIixcImludml0YXRpb25Db2RlXCI6XCJOVzVFRUFsQ1czNFFcIixcImxhc3RMb2dpblRpbWVcIjpcIjIwMjEtMDgtMjZUMTQ6MTY6NTlcIixcInBhcmVudElkXCI6XCIxXCIsXCJwYXNzd29yZFwiOlwiJDJhJDEwJHRpOUJnbVlBY0hJb25mSU1QM2R5R09TamlyQVpmRDBTTkhUVTdiRjV6RURBREJBalQ1Nm5hXCIsXCJwZXJtaXNzaW9uVmVyc2lvblwiOlwibWFpblwiLFwicGhvbmVcIjpcIjE4NzAwMDAwMTAwXCIsXCJ1cGRhdGVBdFwiOlwiMjAyMS0wOC0yNlQxNDoxNjo1OVwiLFwidXNlclNvdXJjZVwiOlwiUkVHSVNURVJcIixcInZpcEV4cGlyZVRpbWVcIjpcIjIwMjEtMTAtMTRUMDA6MDA6MDBcIixcInZpcEdyYWRlVHlwZVwiOlwiR0VORVJBTF9WSVBcIn0ifQ.KaiqGnnyua0jPJd9umCQ9wkHm4ZKUnfCbTvpvnVGZIc"
# # #
# # # a = """
# # # import math
# # #
# # # from locust import task, between, SequentialTaskSet, events, HttpUser, LoadTestShape
# # #
# # #
# # # class AppUsers(SequentialTaskSet):
# # #
# # #     def on_start(self):
# # #         print('----------开始执行子任务---------')
# # #
# # #     def on_stop(self):
# # #         print('---------结束执行子任务----------')
# # #         print('\\n')
# # # """
# # # a1 = """
# # #
# # #     header = {
# # # "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
# # #         "Accept-Language": "zh-CN,zh;q=0.9",
# # #         "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
# # #         "Accept-Encoding": "gzip, deflate, br",
# # #         "authorization": "%s"
# # # }
# # #
# # # """ % token
# # # a2 = """
# # #     @task
# # #     def index_2(self):
# # #         with self.client.get(
# # #                 "%s",
# # #                 headers=self.header, catch_response=True,
# # #                 name='index_2') as response:
# # #             if response.status_code != 200:
# # #                 response.failure('请求出问题了')
# # #         print('index_2:', response.status_code)
# # # """ % url
# # # a3 = """
# # #     #
# # #     # @task
# # #     # def index_3(self):
# # #     #     with self.client.get(
# # #     #             'https://api.test.dylive.aiyingli.com/buy_in/f/v1/live_room/6987643812373859086/trend?searchTypes=IN_LIVE_NUMBER&searchTypes=LEAVE_LIVE_NUMBER&searchTypes=ON_LINE_NUMBER&warningType=IN_LIVE_NUMBER_UP&warningType=IN_LIVE_NUMBER_DOWN&warningType=COMMENT_NUMBER_DOWN&warningType=IN_LIVE_NUMBER&markPoints=true&warnPoints=true&timeType=MINUTE&pointsType=ADD_GOODS',
# # #     #             headers=self.header, catch_response=True,
# # #     #             name='index_3') as response:
# # #     #         if response.status_code != 200:
# # #     #             response.failure('请求出问题了')
# # #     #     print('index_3:', response.status_code)
# # #     #
# # #     # @task
# # #     # def index_4(self):
# # #     #     with self.client.get(
# # #     #             'https://api.test.dylive.aiyingli.com/buy_in/f/v1/live_room/6987643812373859086/flow_source',
# # #     #             headers=self.header, catch_response=True,
# # #     #             name='index_4') as response:
# # #     #         if response.status_code != 200:
# # #     #             response.failure('请求出问题了')
# # #     #     print('index_4:', response.status_code)
# # #     #
# # #     # @task
# # #     # def index_5(self):
# # #     #     with self.client.get(
# # #     #             'https://api.test.dylive.aiyingli.com/buy_in/f/v1/live_room/6987643812373859086/flow_trans',
# # #     #             headers=self.header, catch_response=True,
# # #     #             name='index_5') as response:
# # #     #         if response.status_code != 200:
# # #     #             response.failure('请求出问题了')
# # #     #     print('index_5:', response.status_code)
# # #     #
# # #     # @task
# # #     # def index_6(self):
# # #     #     with self.client.get(
# # #     #             'https://api.test.dylive.aiyingli.com/buy_in/f/v1/live_room/6987643812373859086/comments?current=1&size=50',
# # #     #             headers=self.header, catch_response=True,
# # #     #             name='index_6') as response:
# # #     #         if response.status_code != 200:
# # #     #             response.failure('请求出问题了')
# # #     #     print('index_6:', response.status_code)
# # #     #
# # #     # @task
# # #     # def index_7(self):
# # #     #     with self.client.get(
# # #     #             'https://api.test.dylive.aiyingli.com/buy_in/f/v1/live_room/6987643812373859086/goods?current=1&size=10',
# # #     #             headers=self.header, catch_response=True,
# # #     #             name='index_7') as response:
# # #     #         if response.status_code != 200:
# # #     #             response.failure('请求出问题了')
# # #     #     print('index_7:', response.status_code)
# # #
# # #     @task
# # #     def stop(self):
# # #         self.interrupt()
# # #
# # #
# # # class StepLoadShaper(LoadTestShape):
# # #     setp_time = 100
# # #     setp_load = 1000
# # #     spawn_rate = 10
# # #     time_limit = 100
# # #
# # #     def tick(self):
# # #         run_time = self.get_run_time()
# # #
# # #         if run_time > self.time_limit:
# # #             return None
# # #
# # #         current_step = math.floor(run_time / self.setp_time) + 1
# # #
# # #         return current_step * self.setp_load, self.spawn_rate
# # #
# # #
# # # class NewLinkToG(HttpUser):  # 模拟App用户
# # #     # abstract = True   跳过执行该类
# # #     # host = 'https://api.test.dylive.aiyingli.com'
# # #     host = ''
# # #     wait_time = between(10, 15)  # taskset类中每个def的执行间隔
# # #     tasks = [AppUsers]
# # #
# # #
# # # @events.test_start.add_listener
# # # def on_test_start(**kwargs):  # 监测测试开始
# # #     print('开始执行')
# # #
# # #
# # # @events.test_stop.add_listener
# # # def on_test_stop(environment, **kwargs):  # 监测测试结束
# # #     print('执行结束')
# # #
# # #
# # # @events.request_success.add_listener
# # # def request_success(request_type, name, response_time, response_length, **kwargs):  # 监测请求成功
# # #     result = 'success'
# # #     print("{" + "'message':'{result}' ".format(
# # #         result=result) + "'request_type':'{}','name':'{}','response_time':'{}','response_length':'{}'".format(
# # #         request_type, name, response_time, response_length) + " }")
# # #
# # #
# # # @events.request_failure.add_listener
# # # def request_failure(request_type, name, response_time, response_length, **kwargs):  # 监测请求失败
# # #     result = 'failure'
# # #     print("{" + "'message':'{result}' ".format(
# # #         result=result) + "'request_type':'{}','name':'{}','response_time':'{}','response_length':'{}'".format(
# # #         request_type, name, response_time, response_length) + " }")
# # #
# # #
# # # @events.quitting.add_listener
# # # def _(environment, **kw):
# # #     if environment.stats.total.fail_ratio > 0.01:
# # #         print("Test failed due to failure ratio > 1%")
# # #         environment.process_exit_code = 1
# # #     elif environment.stats.total.avg_response_time > 200:
# # #         print("Test failed due to average response time ratio > 200 ms")
# # #         environment.process_exit_code = 1
# # #     elif environment.stats.total.get_response_time_percentile(0.95) > 800:
# # #         print("Test failed due to 95th percentile response time > 800 ms")
# # #         environment.process_exit_code = 1
# # #     else:
# # #         environment.process_exit_code = 0
# # #
# # #
# # # if __name__ == '__main__':
# # #     import os
# # #
# # #     os.system('locust -f locust-1.py')  # 主机
# # # """
# # #
# # # aa=a+a1+a2+a3
# # # with open("locust.py", mode="w+", encoding="utf-8") as f:
# # #     f.write(aa)
# # a = {'0': {'key': 'KZYTINT449YSPZRC_1630497210', 'install': 'True', 'time_c': '0.08',
# #            'cpu': {'19:54:04': '548', '19:54:05': '0.0', '19:54:07': '124'}, 'time_h': '5.34', 'uninstall': 'True',
# #            'screencaps': {
# #                '19:54:29': 'C:\\Users\\admin\\Desktop\\dcc\\untitled\\polls\\png\\1630497269KZYTINT449YSPZRC.png'}}}
# # s = {'0': {'key': 'KZYTINT449YSPZRC_1630497197', 'Mobile_phone_brands': 'vivo', 'phone_brands_version': 'V1901A',
# #            'Android_version': '9', 'phone_px': '720x1544', 'phone_code': 'KZYTINT449YSPZRC'}}
# # dict_devices_1 = dict(a['0'], **s['0'])
# # print(s)
#
# caseapi_return = {'code': '', 'msg': '',
#                   'equipment': {'0': {'entry_name': '1', 'Iterative_version': '1', 'modular': '1', 'case_name': '1'},
#                                 '1': {'entry_name': '2', 'Iterative_version': '2', 'modular': '2', 'case_name':
#                                     '2'}}}
# for i in range(len(caseapi_return['equipment'])):
#     print(caseapi_return['equipment'][str(i)])
# import time
# now_time = time.strftime("%Y%m%d%H", time.localtime()) + "00"
# a = '{"Authorization":"token","Content-Type":"application/json;charset=UTF-8","d-t":"","Accept-Language":"zh-CN,zh;q=0.9"}'
# a.replace('token',"Content-Type")
# aa =str(round(time.time() * 1000))
# print(aa,now_time)

data = '{"code":200,"msg":"ok"}'

import re
import ast
a = ast.literal_eval(re.search('({.+})', data).group(0))
print(a)